import Vue from 'vue'

import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
		movieLocation:{
			name:'',
			latitude:'',
			longitude:'',
			cityCode: '',
			cityName: '',
			regionCode: "",
			regionName: "",
		},
		userLocation:{
			latitude:'',
			longitude:'',
			province:'',
			city:'',
		},
		currentPosition:{
			latitude:'',
			longitude:'',
			province:'',
			city:''
		},
		
		
		orderInfo:{
			
		},
		
	},
    mutations: {
		changeLocation(state, step) {
			state.movieLocation = step
		},
		changeUserLocation(state,step){
			let data = step
			data.latitude = Number(data.latitude).toFixed(6)
			data.longitude = Number(data.longitude).toFixed(6)
			state.userLocation = step
		},
		changeCurrentPosition(state,step){
			state.currentPosition = step
		}
	}
})
export default store
